<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="autor" content="Breezy New Media (info@breezy.cz)" />
<meta name="copyright" content="PointSpace - free website layout 2008" />
<meta name="description" content=""  />
<meta name="keywords" content="" />
<title>Advanced Databases TUE - Manage Artist </title>
<link rel="stylesheet" type="text/css" href="./css/default.css" media="screen" />
<link rel="stylesheet" type="text/css" href="./css/print.css" media="print" />
</head>
<f:view>
<body>

<div id="view">
  <div id="head">
    <div id="logo">
      <a href="" class="block">&nbsp;</a>
      <h1><a href="index.html">advanced<span>Databases</span></a></h1>
      <h2><a href="index.html">the music you are looking for..!</a></h2>
    </div>
     <hr class="hidden" />
    
    <jsp:include page="userMenu.jsp"/>
    
    <hr class="hidden" />
  </div>
  
  
  
  <div id="content">
    <div id="contentBlock">
    
	    <h:form id="form1">
	    	
	      <div class="item last">
			<table style="border:0px">
				
				<tr>
	                <td>
	                    <h4>Manage Artist</h4>                
	                </td>
	            </tr>
	            <tr>
	                <td>
	                    Artist Name <br />
	                    <h:inputText id="txtArtistName" size="64" required="true" value="#{artistSearchEngineBean.defaultArtist.name}" >	
	                    				<f:validateLength minimum="3" maximum="64" />	
	                    </h:inputText>
	                </td>
	            </tr>
	            <tr>
	                <td>
	                    Description <br />
	                    <h:inputTextarea id="txtArtistDescription" cols="90" rows="5" required="true"
	                    	value="#{artistSearchEngineBean.defaultArtist.description}" ></h:inputTextarea>                            
	                </td>
	            </tr>    
	            <tr>
	                <td>
	                    Image url<br />
	                    <h:inputText id="txtImage" size="80" required="true"
	                    	value="#{artistSearchEngineBean.defaultArtist.image}" ></h:inputText>                            
	                </td>
	            </tr>
	            <tr>
	                <td>
	                    Url<br />
	                    <h:inputText id="txtUrl" size="80" required="true" value="#{artistSearchEngineBean.defaultArtist.url}" ></h:inputText>                            
	                </td>
	            </tr>			
			</table>
	      </div>
         		<h:messages id="errorMessages" style="color:darkred"></h:messages>
	       <div id="">
	       		<h:outputLabel id="lblStatus" value="#{artistSearchEngineBean.status}"></h:outputLabel>
	           <br />
	           <h:commandButton id="btnDelete" styleClass="submit" rendered="#{artistSearchEngineBean.isNew == false}"
	           		action="#{artistSearchEngineBean.btnDelete}" value="Delete"></h:commandButton>
	           &nbsp;&nbsp;
	           <h:commandButton id="btnNew" styleClass="submit" rendered="#{artistSearchEngineBean.isNew == false}"
	            	action="#{artistSearchEngineBean.btnNew}" value="New"></h:commandButton>
	           &nbsp;&nbsp;
	           <h:commandButton id="btnSave" styleClass="submit"
	           		action="#{artistSearchEngineBean.btnSave}" value="Save"></h:commandButton>
	       </div>
       
      </h:form> 
      <br />
       <h:form id="form2">
        <div id="divGenres" class="item last">
			<table style="border:0px">
	            <tr>
	                <td>
	                    <h:outputLabel rendered="#{artistSearchEngineBean.isNew == false}">Genre</h:outputLabel><br />
	                    <h:inputText id="txtGenre" size="64" required="true" value="#{artistSearchEngineBean.defaultArtist.genre}" rendered="#{artistSearchEngineBean.isNew == false}">	
	                    				<f:validateLength minimum="3" maximum="64" />	
	                    </h:inputText>
	                    <h:commandButton id="saveGenre" styleClass="submit" rendered="#{artistSearchEngineBean.isNew == false}"
	           				action="#{artistSearchEngineBean.addGenre}" value="Add genre"></h:commandButton>
	                </td>
	            </tr>
	            <tr>
	                <td>
	                	<h:outputLabel rendered="#{artistSearchEngineBean.isNew == false}">
	                		Genres for  
	                		<h:outputText value="#{artistSearchEngineBean.defaultArtist.id}" rendered="#{artistSearchEngineBean.isNew == false}"/>
	                	</h:outputLabel>
	                	
	                    <h:dataTable style="border:0px" value="#{artistSearchEngineBean.genresByArtist}" var="item" >
							<h:column>
								<table style="border:0px">
									<tr>
										<td>
											<h:outputText value="#{item.genre}"/>
											<f:subview id="remove">	
											<div style="position:relative;left:-35px;top:-15px">	
														<h:commandLink styleClass="remove" action="#{artistSearchEngineBean.removeGenre}">
															<h:graphicImage style="margin:0px;vertical-align:bottom;"  value="images/ico/comment-remove.png"></h:graphicImage>	
															<f:param name="genreKey" value="#{item.genre}"></f:param>
														</h:commandLink>
											</div>								
											</f:subview>
										</td>
									</tr>
								</table>								
							</h:column>
						</h:dataTable>				              
	                </td>
	            </tr>   
			</table>
	      </div>
      </h:form>
     	
            
    </div>
 <!-- here was div -->
  
   
    <hr class="hidden" />
        <div id="menuBlock">
	      <div class="box boxText">
	        <f:subview id="admin3" rendered="#{artistSearchEngineBean.isNew == false}">
	      	   <h:form>
					<h:commandLink styleClass="add" title="Add Album" action="#{albumSearchEngineBean.accessAddAlbum}">
						<h:graphicImage style="padding-left:2px;margin:0px;vertical-align:bottom;"  value="images/ico/add_album.png"></h:graphicImage>
						<f:param name="artistKey" value="#{artistSearchEngineBean.defaultArtist.id}"></f:param>
					</h:commandLink>					
					<h:commandLink styleClass="add" value="Add Album" action="#{albumSearchEngineBean.accessAddAlbum}">
						<f:param name="artistKey" value="#{artistSearchEngineBean.defaultArtist.id}"></f:param>
					</h:commandLink>
	      	   </h:form>
		  	</f:subview>
	      </div>
   	   </div>
  
  
  <!--  added div here -->
 </div> 
  
  <div id="foot">
    <p class="fl">&copy; all rights reserved</p>
    
    <!-- /#   LINKS AND AUTHOR-SIGNATURE CANNOT BE REMOVED !!! -->
    <p class="fr"><a href="www.tue.nl" title="See more ON">TUE</a> created by <a href="http://www.tue.nl" class="ico ico-breezy">TUE</a></p>
  </div>
</div>

</body>
</f:view>
</html>
